package code;
/**
 * This abstract class contains the similar methods for bank accounts either Savings or Checking account.
 * 
 * @author justinwong
 *
 */

public abstract class BankAccounts {
	protected int fAccountNumber;
	protected static int fNextAccountNumber = 0;
	protected static double costs = 1; // per period there is a cost associated with this account that equals 1 pound
	protected double fBalance;
	
	/**
	 * Method used to determine if user can withdraw from the account. 
	 */
	public abstract boolean withdrawal(double amount);
	/**
	 * Determines if two objects are the same. 
	 */
	public abstract boolean equals(Object o);
	
	/**
	 * Gets balance
	 * @return the balance
	 */
	public double getBalance()
	{
		return fBalance;
	}
	
	/**
	 * Increase the balance
	 * @param amount to increase by
	 */
	public void increaseBalance(double amount)
	{
		if(amount > 0.0){
			fBalance += amount;
		}
	}
	
	/**
	 * Decrease the balance
	 * @param amount to decrease by
	 */
	public void decreaseBalance(double amount)
	{
		if(amount > 0.0){
			fBalance -= amount;
		}
	}
	
	/**
	 * Set the balance
	 * @param amount to set
	 */
	public void setBalance(double amount)
	{
		fBalance = amount;	
	}

	/**
	 * Gets the account number
	 * @return account number.
	 */
	public int getAccountNumber() 
	{
		return fAccountNumber;	
	}

}
